package lion.blog.tag.func;

import lion.blog.model.BlogArticle;
import lion.blog.util.BlogUtil;
import lion.dev.lang.MapJ;

/**
 * @author lion
 * @email hl_0074@sina.com
 * @date 2015年9月23日
 */
public class ArticleLinkFunc {

	public static String getLink(Object article, String catelog) {

		if (article == null) { return ""; }

		MapJ blogArticle = new MapJ();
		if (article instanceof MapJ) {
			blogArticle = (MapJ) article;
		} else if (article instanceof BlogArticle) {
			blogArticle = ((BlogArticle) article).valueMap();
		}

		return BlogUtil.getBlogLink(blogArticle, catelog);
	}
}
